#include <iostream>

struct job{
    char name[10];
    int age;
};

template<typename T> void Swap(T& a,T& b);

template<> void Swap<job>(job& j1,job& j2);      // 特化(Specializations),为某个特定的对象生成特殊的版本

int main(){
    using namespace std;
    job j1 = {"zs",14},j2 = {"ls",20};
    Swap(j1,j2);
    cout<<j1.age<<endl;

    return 0;
}

template<typename T> void Swap(T& a,T& b){
    T temp = a;
    a = b;
    b = temp;
}
template<> void Swap<job>(job& j1,job& j2){
    int age = j1.age;
    j1.age = j2.age;
    j2.age = age;
}